package com.mobile.weather.controller;

import com.mobile.weather.client.UserClient;
import com.mobile.weather.domain.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {

    @Autowired
    UserClient userClient;


    /*
    1.我们当前工程需要使用Feign调用其他微服务
    具体步骤：
    ①导入包  ②开启开关  ③定义一个接口假装要调用的服务提供者

    2.接下来就定义一个Controller来测试这个调用能否成功
     */
    @RequestMapping("/get/{userId}")
    public String get(@PathVariable("userId") Integer userId){
        System.out.println("into 10002 get ..................");
       String result=userClient.list(1,2);

       return result;
    }

}
